<? include("/includes/header.php"); ?>
<title>TMS - Login</title>
</head>
<body>
        <style>
            table *{border:1px solid green;}
        </style>
        <table>
		<?php
        $host = "localhost";
        $port = 3306;
        $socket = "";
        $user = "root";
        $password = "";
        $dbname = "tms";
        
        $con = new mysqli($host, $user, $password, $dbname, $port, $socket)
        or die('Could not connect to the database server' . mysqli_connect_error());
        
        //$con->close();
        $query = "SELECT department_id,name FROM tms.department order by department_id";
        
        
        if ($stmt = $con->prepare($query)) {
        $stmt->execute();
        $stmt->bind_result($department_id, $name);
        while ($stmt->fetch()) {
        echo "<tr><td>$department_id</td><td>$name</td></tr>";
        }
        $stmt->close();
        }
        ?>
        </table>
<? include("/includes/footer.php"); ?>